|
|
|
| |
|
|
|
|
Because application security works only within the selected application, it cannot affect users who are accessing the database from other applications. Therefore, you should not rely on application-level security as the only security scheme for your critical data. Still, application security can provide powerful security controls to your Visual Basic database applications. |
|
|
|
|
|
|
|
|
|
|
In order to provide user login and logout and access rights checking, in this lesson you build a set of routines in a new OLE Server library called usrObject. This library contains all the properties and methods needed to install and maintain application-level security for all your Visual Basic database applications. |
|
|
|
|
|
|
|
|
Developing a User Login/Logout System |
|
|
|
|
|
|
|
|
The first routines you need to build as part of your application security OLE library enable application administrators to create and maintain a list of valid application users. This involves creating a simple data entry form that contains add, edit, and delete operations for a Users table. Next, you need routines to process user logins and logouts. The login routine prompts potential users for their user ID and password, and checks the values entered against the data table on file. As usual, you construct these routines in a way that makes it easy for you to use them in any future Visual Basic database applications. |
|
|
|
|
|
|
|
|
Building the User Maintenance Form |
|
|
|
|
|
|
|
|
Load Visual Basic 5 and start a new ActiveX DLL project. The first thing you do is create a form to manage the list of valid application users. This form enables you to add, edit, and delete users from a table called secUsers. This is the same table used to verify user logins at the start of all your secured applications. Use Table 21.1 and Figure 21.1 to build the first page of the User Maintenance tabbed dialog. |
|
|
|
|
|
|
|
|
Before building this form, however, you need to add two reference entries and two custom controls to your project. Refer to the following list to make sure you load all the additional files needed for this project. |
|
|
|
|
|
|
|
|
· Microsoft Data Bound Grid control |
|
|
|
|
|
|
|
|
· Microsoft Tabbed Dialog control 5.0 |
|
|
|
|
|
|
|
|
·TYSDBVB5, the data entry library (prjRecObject.dll) |
|
|
|
|
|
|
|
|
· Microsoft DAO 3.5 object library |
|
|
|
|
|